package com.orafl.use.comorafluse.IOC.Lookup;

import org.springframework.beans.BeansException;
import org.springframework.beans.factory.BeanFactory;
import org.springframework.beans.factory.FactoryBean;
import org.springframework.beans.factory.ObjectFactory;
import org.springframework.beans.factory.config.ObjectFactoryCreatingFactoryBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Primary;
import org.springframework.stereotype.Component;

import javax.naming.Context;
import javax.naming.Name;

import java.util.Hashtable;

@Component
@Configuration
public class ObjectFactoryTest  {

    @Bean
    public ObjectFactoryCreatingFactoryBean ObjectFactoryTest() {
        ObjectFactoryCreatingFactoryBean o = new ObjectFactoryCreatingFactoryBean();
        o.setTargetBeanName("lookUpBean");
        return o;
    }


    @Bean
    /*@Primary*/
    public LookUpBean test() {
        LookUpBean abc = new LookUpBean();
        abc.setName("testabcssd");
        return abc;
    }

}
